<!--
 * @Author: your name
 * @Date: 2020-02-28 15:12:11
 * @LastEditTime: 2020-02-28 15:26:52
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \javascript_teaching\codes\chapter2\2-1.html
 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>通过常量求圆的周长</title>
    <script>
        // 求一个半径为2.5cm的圆形的周长
        var c;
        var r = 2.5;
        const p = Math.PI;
        c = p * r * 2;
        // alert("半径为2.5cm的圆的周长为：" + c + "cm");
        document.write("半径为2.5cm的圆的周长为：" + c + "cm");
    </script>
</head>
<body>
    
</body>
</html>